#ifndef PLAYLIST_H
#define PLAYLIST_H

#include <list>
#include <string>
#include <sstream>

#include "Song.h"
#include "Observable.h"

/*----------------------------------------------------------------------------------------------------
--
--	CLASS: Playlist
--
--	Date: March 27, 2010
--
--	REVISIONS (Date and Description):
--
--	DESIGNER: Erick Ribeiro
--
--	PROGRAMMER: Erick Ribeiro
--
--  INTERFACE: class Playlist : public Observable
--
--  RETURNS: N/A
--
--	NOTES: Program class that handles the Playlist of the program. Displays a list of songs to
--         be played and the number of votes each song has. This class is responsible for updating
--         the list of songs/number of votes for each song and sending them to all clients.
--
----------------------------------------------------------------------------------------------------*/
class Playlist : public Observable
{
    public:
        Playlist();

        void addSong(Song * s);
        bool removeSong(std::string filename);
        bool voteSong(std::string filename);

        Song * getMostVoted ();
        std::string getMostVotesSong();

        void setPlaying(Song * s);
        Song * getPlaying();

        Song * getSong(std::string filename);

        bool hasNext ();
        Song * next ();

        std::list<Song *> copySongList ();
        std::string parseToString();

        enum EventCodes { SongAdded, SongRemoved, VotesChanged, NowPlayingChanged };

    private:
        std::list<Song *> playlist;
        Song * playing;
};

#endif
